/*
 * @lc app=leetcode.cn id=283 lang=java
 *
 * [283] 移动零
 */

// @lc code=start
class Solution {
    public void moveZeroes(int[] nums) {
        int n = nums.length;
        int l = 0, r = 0;
        for(;r<n;r++){
            if(nums[r] != 0){
                nums[l++] = nums[r];
            }
        }
        while(l<n){
            nums[l++] = 0;
        }
    }
}
// @lc code=end

